package com.zhiyou.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.fasterxml.jackson.annotation.JsonTypeInfo.Id;
import com.zhiyou.model.FYParent;
import com.zhiyou.model.FyClass;
import com.zhiyou.model.FyStudent;
import com.zhiyou.service.FYParentService;
import com.zhiyou.utils.JsonResult;
@RestController
@RequestMapping("fyparent/")
public class FYParentController  {

	@Autowired
	FYParentService fyParentService;
	//根据班级id查询该班家长
	@GetMapping("list/{class_id}")
	public JsonResult show(@PathVariable("class_id") Integer ciass_id, HttpServletRequest request, HttpServletResponse response){
		
		return new JsonResult(fyParentService.select(ciass_id),"查询成功");
		
	}
	//根据名字模糊查询家长
	@GetMapping("list1/{student_name}")
	public JsonResult show1(@PathVariable("student_name") String student_name, HttpServletRequest request, HttpServletResponse response){
		
		return new JsonResult(fyParentService.selectName(student_name),"查询student_id成功");
		
	}

}

